 var linkurl = "http://"+window.location.host+"/";
     $(function () {
	$(".search_button3").click(function () {
	    var search = $("#search_key").val();
	    if(search!=""){
	        window.location.href = "../sousuojieguo.html?search=" + search;
	    }
	});
        
        $.ajax({
            type: 'get',
            url : linkurl + "getXunrenClassifyList",
            data: {},
            dataType: 'json',
            error:function (){alert("error");},
            success: function (Result) {
                var  data = Result.data;
                $("#pcc-classify").html("");
                $.each(data, function (index,item) {
                    $("#pcc-classify").append("<a href='../d-"+item.id+"/'>"+item.className+"</a>")
                })
            }
        });
        $.ajax({
            type : "get",
            url : linkurl + "isLoged",
            data: {},
            dataType: 'json',
            success:function (Result) {
                var result = Result.result;
                if(result==1){
                    $(".pcc_gerenbnt").removeClass("hide");
                    $("#to-login").addClass("hide");
                    $("#to-reg").addClass("hide");
                }
            }
        });
        $.ajax({
            type: 'get',
            url : linkurl + "modifyArticlehits",
            data: {id:$('#getID').val()},
            dataType: 'json',
            error:function (){alert("error");},
            success: function (Result) { 
                   $('#readhits').html("阅读量："+Result.data)			
            }
        });
   	 $.ajax({
	        type : "get",
	        url : linkurl + "getzuixinXunrenList",
	        data: {pagesize:3},
	        dataType: 'json',
	        success:function (Result) {
	            var data = Result.data;
	            $("#pcc-foot-x").html("");
	            $.each(data, function (index,item) {
	                $("#pcc-foot-x").append("<div class='pcc-articlefool' ><a class='live_xunren_list' href='../"+item.url+"/"+item.linkUrl+"'>["+item.provinceName+"]"+item.title+"</a>" +
	                    "<p>"+item.content+"</p></div>");
	            });
	        }
	    });
	    $.ajax({
	        type : "get",
	        url : linkurl + "getTopDiqu",
	        data: {},
	        dataType: 'json',
	        success:function (Result) {
	            var data = Result.data;
	            $("#pcc-foot-c").html("");
	            $.each(data,function (index,item) {
	                $("#pcc-foot-c").append("<a class='pcc_fooldiquxunren' href='../a-"+item.url+"/'>"+item.diquName+"寻人</a>")
	            })
	        }
	    });

        $("#pcc-logout").click(function () {
            $.ajax({
                type : "post",
                url : linkurl + "logout",
                data: {},
                dataType: 'json',
                success:function () {
                    $(".pcc_gerenbnt").addClass("hide");
                    $("#to-login").removeClass("hide");
                    $("#to-reg").removeClass("hide");
                }
            })
        });
       
    })


     function dateFormatUtil(longTypeDate){
        var dateTypeDate = "";
        var date = new Date();
        date.setTime(longTypeDate);
        dateTypeDate += date.getFullYear();   
        dateTypeDate += "-" + getMonth(date); 
        dateTypeDate += "-" + getDay(date);    
        return dateTypeDate;
    }

     function getMonth(date){
        var month = "";
        month = date.getMonth() + 1;  
        if(month<10){
            month = "0" + month;
        }
        return month;
    }

     function getDay(date){
        var day = "";
        day = date.getDate();
        if(day<10){
            day = "0" + day;
        }
        return day;
    }